<template>
	<el-dialog :title="form.modelName" v-model="open" width="800px" @open="initOpen" append-to-body :before-close="close"
		@close="close">
		<!-- <p class="dialogTitle">{{form.modelName}}</p> -->
		<el-form ref="rescueforceRef" :model="form" label-width="120px">
			<el-row>
				<el-col :span="12">
					<el-form-item label="模型名称" prop="modelName">
						{{form.modelName}}
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="是否默认" prop="">
						{{form.isDefault=='0'?'否':'是'}}
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="地区" prop="">
						{{form.province}} - {{form.city}}
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="维护人" prop="">
						{{form.createUserName}}
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="维护人单位" prop="">
						{{form.orgName}}
					</el-form-item>
				</el-col>
			</el-row>
			<el-divider border-style="dashed"></el-divider>
			<el-row>
				<el-col :span="6" class="tab-title">
					救援队伍需求模型
				</el-col>
			</el-row>
			<el-row style="margin: 20px 0;font-size: 15px;">
				<el-col :span="22" :offset="2">
					救援队伍包括专业救援力量、民间救援力量和社会其他力量。救援队伍与震级、灾区人数有关。模型公式：
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="18" :offset="4">
					<span style="font-size: 16px;">

						1、M＜5：以当地驻军和武警消防为主，基本无需外地救援队伍。<br /><br />
						2、5 ≤ M＜6：R<sub>r</sub> = R * {{form.rescueRanksModelNumber1}}(0.8% ~ 1%)<br /><br />
						3、6 ≤ M＜7：R<sub>r</sub> = R * {{form.rescueRanksModelNumber2}}(0.5% ~ 1%)<br /><br />
						4、M ≥ 7：R<sub>r</sub> = R * {{form.rescueRanksModelNumber3}}(3% ~ 5%)<br /><br />
						5、无论震级多大，所需救援队伍人数上限值为20万人。<br /><br />
						参数说明：M--地震震级；R<sub>r</sub>--救援需求人数（人）；R--受灾人数（人）<br /><br />
						6、其中专业救援力量占{{form.majorRescueForceProportion}}%、民间救援力量{{form.popularRescueForceProportion}}%、社会其他力量{{form.societyOtherForceProportion}}%。<br /><br />
					</span>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="6" class="tab-title">
					医务人员需求模型
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="16" :offset="4">
					<span style="font-size: 16px;">
						医务人员分为医生、护士、心理医生。<br />
						医务人员需求与救援人员需求成一定比例：<br /><br />
						Yd = R<sub>r</sub> * {{form.medicalStaffModelNumber}} (0.05 ~ 0.1)<br /><br />

						参数说明： Yd--医务人员需求（人）； R<sub>r</sub>--救援需求人数（人）<br />
						其中医生占{{form.doctorProportion}}%、护士占{{form.nurseProportion}}%、心理医生占{{form.psychologistProportion}}%。<br />
					</span>
				</el-col>
			</el-row>
		</el-form>
		<template #footer>
			<div class="dialog-footer">
				<el-button type="primary" @click="close">关闭</el-button>
			</div>
		</template>
	</el-dialog>
</template>
<script setup>
import { getRescueForceConomicModelById } from '@/api/earthquakeLossesEstimation/earthquakeSetting'

const props = defineProps({
	open: Boolean,
	id: {
		type: String,
		default: ''
	}
})
const emits = defineEmits(['update:open'])
const data = reactive({
	form: {
		modelName: '',
		isDefault: '',
		province: '',
		city: '',
		createUserName: '',
		orgName: ''
	}
})
const { form } = toRefs(data)
// 查询模型详情
const getModelDetail = () => {
	getRescueForceConomicModelById(props.id).then(res => {
		if (res.code == 200) {
			res.data && (form.value = res.data)
		}
	})
}

const initOpen = () => {
	getModelDetail()
}
const close = () => {
	emits('update:open', false)
}
</script>
<style scoped lang="scss">
.el-form {
	padding-top: 20px;
	.el-form-item {
		margin-bottom: 0;
	}
}

.tab-title {
	font-size: 16px;
	font-weight: bold;
	border-left: 4px solid var(--el-color-primary);
	font-family: PingFangSC-Medium;
	padding-left: 10px;
	margin-bottom: 20px;
}
</style>